package com.jiapu.mapper;

import com.jiapu.entity.Family_information;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface Family_informationMapper{
    @Select("select * from family_information where id_del=0")
    List<Family_information> findAllf();

    @Transactional
    @Update("insert into `family_information` (`family_id`,`family_name`,`date_initiate`,`header_id`,`id_del`) VALUES (#{family_id},#{family_name},#{date_initiate},#{header_id},0);")
    void savef(Family_information family_information);

    @Transactional
    @Update("update family_information set family_name=#{family_name},date_initiate=#{date_initiate},header_id=#{header_id} where family_id=#{family_id}")
    void updateByIdf(Family_information family_information);

    @Transactional
    @Update("update family_information set id_del=1 where family_id=#{family_id}")
    void deleteByIdf(Family_information family_information);
}
